from pydantic import BaseModel, Field
from typing import List, Optional
from datetime import datetime

# 请求模型
class ContentGenerateRequest(BaseModel):
    userId: str
    type: str
    platform: str
    description: str
    referenceTitle: Optional[str] = None
    referenceContent: Optional[str] = None

class ContentContinuationRequest(BaseModel):
    userId: str
    type: Optional[str] = None
    platform: Optional[str] = None
    originalContent: str
    description: str
    referenceTitle: Optional[str] = None
    referenceContent: Optional[str] = None

class ContentAdaptationRequest(BaseModel):
    userId: str
    type: Optional[str] = None
    platform: Optional[str] = None
    originalContent: str
    contentToBeAdapted: str
    description: str
    referenceTitle: Optional[str] = None
    referenceContent: Optional[str] = None

class ContentAssessmentRequest(BaseModel):
    type: str
    platform: str
    content: str

# 响应模型
class ContentGenerateResponse(BaseModel):
    title: str
    content: str
    hashtag: Optional[List[str]] = None 
    createdAt: str
    totalToken: int

class ContentContinuationResponse(BaseModel):
    content: str
    createdAt: str
    totalToken: int

class ContentAdaptationResponse(BaseModel):
    content: str
    createdAt: str
    totalToken: int

class ContentAssessmentResponse(BaseModel):
    ifRecommend: bool
    tags: List[str]
    recommendReason: str

class ContentResponse(BaseModel):
    code: int = 200
    message: str
    data: Optional[ContentGenerateResponse | ContentContinuationResponse | ContentAdaptationResponse | ContentAssessmentResponse] = None